<template>
    <div>
        <div class="page-body">
            <div class="page-header">
                <img v-if="!cardData._profile" :src="defaultImg" alt="" srcset="">
                <img v-else :src="cardData._profile" alt="" srcset="">
                <div>
                    <div class="page-title"><sex-icon style="margin-right:5px" :sex="cardData.Sex" />
                        <img v-if="isDouYin" style="display: block;width:20px;margin-right:5px" :src="dyImg" alt="">{{
                            cardData.Name }}
                    </div>
                    <div style="margin-top:3px;">{{ cardData.Phone }}</div>
                </div>
            </div>
            <div class="page-footer" v-if="$slots.footer">
                <slot name="footer">
                </slot>
            </div>
        </div>
    </div>
</template>
  
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
    name: "BizUserCard",
})
</script>
  
<script lang="ts" setup>
import { DefaultProps } from "element-plus";
import { ref, nextTick } from "vue";
import { BizUserDataClass } from "@/model/BizUser";
import SexIcon from "@/components/SexIcon";


let props = withDefaults(defineProps<{
    cardData: BizUserDataClass,
    isDouYin?: boolean,
}>(), {
    isDouYin: false
})

let defaultImg = ref(require("@/assets/app/tx.svg"));

let dyImg = ref(require("@/assets/app/douyin.png"))
</script>
  
<style lang="less" scoped>
.page-body {
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    transition: 0.2s;

    &:hover {
        box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.05);
    }
}

.page-header {
    padding: 10px;
    // border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;

    &>img {
        width: 46px;
        height: 46px;
        flex-shrink: 0;
        margin-right: 10px;
        border-radius: 3px;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
}

.page-title {
    display: flex;
    align-items: center;
}

.page-content {
    padding: 10px;

}

.page-contenttext {
    color: rgba(0, 0, 0, 0.5);

    font-size: 13px;
    line-height: 17px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    height: 51px;
}

.page-footer {
    padding: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);

}
</style>